import numpy as np


def load_csv():
    data = []
    with open('../data_test/电信用户流失数据/CustomerSurvival.csv', 'r') as f:
        for line in f.readlines():
            data.append(tuple(line[:-1].split(',')))
            data = np.array(data, dtype={'names': ['index', 'pack_type', 'extra_time', 'extra_flow', 'pack_change',
                                                   'contract', 'asso_pur', 'group_user', 'use_month', 'loss'],
                                         'formats': ['i4', 'i4', 'f4', 'f4', 'i4', 'i4', 'i4', 'i4', 'i4', 'i4']})


load_csv()
